﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Team4sCMDB
{
    public class Model : AccessDatabase
    {
        public Model(string pathToDatabase):base(pathToDatabase)
        {
            
        }

        public DataTable getPcs()
        {
            DataTable result = executeSelectStatement("SELECT * FROM pc;");

            return result;
        }

        public DataTable getPc(int pcId)
        {
            //DataTable result = executeSelectStatement("SELECT ci.CInr, ci.OudCI, ci.SerieNr, ci.StatusNr, ci.ModelNr, ci.Aanschafprijs, ci.Aanschafdatum, ci.LocatieNr, pc.PcId, pc.TypeNr, pc.Restwaarde, pc.Beschrijving FROM ci INNER JOIN pc ON ci.CInr = pc.CInr WHERE (((pc.PcId)=" + pcId + "));");
            DataTable result = executeSelectStatement("SELECT ci.*, pc.* FROM ci INNER JOIN pc ON ci.CInr = pc.CInr WHERE (((pc.PcId)=" + pcId + "));");

            return result;
        }
    }
}
